package com.huabo.system.service.impl;


import com.huabo.system.mysql.entity.TblVersionMySql;
import com.huabo.system.mysql.mapper.TblVersionMySqlMapper;
import com.huabo.system.oracle.entity.TblVersion;
import com.huabo.system.oracle.mapper.TblVersionMapper;
import com.huabo.system.service.TblVersionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("TblVersionService")
public class TblVersionServiceImpl implements TblVersionService {

    @Resource
    private TblVersionMapper tblVersionMapper;

    @Resource
    private TblVersionMySqlMapper tblVersionMySqlMapper;

    @Override
    public TblVersion findbyFid(String fid) {
        List<TblVersion> findBysqlOne = tblVersionMapper.findByfid(fid);
        if (findBysqlOne.size() > 0) {
            return findBysqlOne.get(0);
        } else {
            return null;
        }
    }

    @Override
    public TblVersionMySql findbyMySqlFid(String fid) {
        List<TblVersionMySql> findBysqlOne = tblVersionMySqlMapper.findByfid(fid);
        if (findBysqlOne.size() > 0) {
            return findBysqlOne.get(0);
        } else {
            return null;
        }
    }

    @Override
    public List<TblVersion> selectAllTblVersion() {
        List<TblVersion> tblVersions = tblVersionMapper.findBysql();
        return tblVersions;
    }

    @Override
    public List<TblVersionMySql> selectAllMySqlTblVersion() {
        List<TblVersionMySql> tblVersions = tblVersionMySqlMapper.findBysql();
        return tblVersions;
    }
}
